import type { PackageSearchParams, PackageVO, Tenants } from '@/service/types/tenant';
import { request } from '@/service/request';

export function getPageList(params?: PackageSearchParams) {
  return request<Tenants.PackageVo>({
    url: '/system/tenant/package/list',
    method: 'get',
    params
  });
}

export function getPackageList() {
  return request<Array<PackageVO>>({
    url: '/system/tenant/package/selectList',
    method: 'get'
  });
}

export function addPackage(data: PackageVO) {
  return request({
    url: '/system/tenant/package',
    method: 'post',
    data
  });
}

export function editPackage(data: PackageVO) {
  return request({
    url: '/system/tenant/package',
    method: 'put',
    data
  });
}

export function delPackage(ids: number[] | number) {
  return request({
    url: `/system/tenant/package/${ids}`,
    method: 'delete'
  });
}

export function getPackage(id: number) {
  return request<PackageVO>({
    url: `/system/tenant/package/${id}`,
    method: 'get'
  });
}
